package _14作业.t1;

import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;

public class Demo3 {
    public static void main(String[] args) {
        HashMap<String,String> map=new HashMap<>();
        map.put("张飞","18");
        map.put("刘备","21");
        map.put("关羽","22");

        Collection<String> values = map.values();
        Iterator<String> iterator = values.iterator();
        while (iterator.hasNext()){
            String value = iterator.next();
            System.out.println(value);
        }


        for (String value : values) {
            System.out.println(value);
        }
    }
}
